<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        (function () {
            var log = console.log
            window.console.log = function () {
                log('frame inside', ...arguments)
            }
        })()
    </script>
</head>

<body>
    <div>
        this is a Frame;
    </div>
    <script>
        console.log(window.top);
        console.log(top.document);
        top.console.log('i am outsite')
        console.log(window.document);
    </script>
</body>

</html>